package com.example.webpractice;

import com.example.webpractice.controller.TestController;
import com.example.webpractice.utils.Result;


public class Main {

    public static void main() {
        TestController testController = new TestController();
        int a = 10;
        int b = 20;
        int c = 30;
        String op1 = "*";
        String op2 = "+";
        int d = testController.calGet1(10, 20, op1);
        System.out.printf("%d %s %d = %s\n", a, op1, b, d);

        Result r = testController.calGet2(b, c, op2);
        if (r.getCode() == 0) {
            System.out.printf("%d %s %d = %s\n", a, op2, b, r.getResult());
        } else {
            System.out.println(r.getErrMsg());
        }

    }
}
